﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using brockredge.CLASSES;


namespace brockredge
{
    public partial class ApproveUser : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var str_user_id = Request.QueryString["q"];
                var v_user_id = StringExt.decryptString(str_user_id).ToGuid().ToString().ToUpper();

                testDataContext tdc = new testDataContext();
                User_Membership um = tdc.User_Memberships.Single(u => u.user_id == v_user_id.ToGuid());
                um.IsApproved = 1;
                tdc.SubmitChanges();
                Label1.Text = "YOU HAVE BEEN APPROVED!";
               
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message;
            }
               

        }
    }
}